import {Component} from "react";
import {Avatar, Image, Space} from "antd";
import {fallbackImage} from '../../../../assets/settings.json'

class AvatarDetail extends Component<any, any> {

    props = {
        headImg: '',
        nickName: ''
    }

    constructor(props: any) {
        super(props);

        this.props = props;
    }

    render() {
        const {headImg, nickName} = this.props
        const headImgUrl = `${window.location.origin}/avatar/${headImg}`

        return (
            <>
                <Space>
                    <Avatar shape={"square"} size={"small"} src={<Image src={headImgUrl} fallback={fallbackImage}/> }/>
                    {nickName}
                </Space>
            </>
        )
    }
}

export default AvatarDetail;
